<template>
  <div>
    <label for="">name</label
    ><input type="text" v-model="form.name" @change="handleChange" />
  </div>
</template>
<script lang="ts">
import { defineComponent, ref } from "vue";

export default defineComponent({
  emits: ["searchPage"],
  setup(props, ctx) {
    const form = ref({ name: "" });
    const handleChange = () => {
      ctx.emit("searchPage", (row: any) => {
        return row.name.indexOf(form.value.name) > -1;
      });
    };
    return {
      form,
      handleChange,
    };
  },
});
</script>
